<div ng-controller="StoreCtrl" ng-init="addAction()" class="sui-form form-horizontal">
    <ul class="sui-breadcrumb">
        <li><a href="#/store/list">{{'store'|translate}}</a></li>
        <li class="active"> {{store.store_id?'edit':'add_new'|translate}}</li>
    </ul>
    <form name="storeForm" novalidate ng-if="store">
        <div class="control-group">
            <label class="control-label v-top">{{'Shop Name'|translate}}:</label>
            <div class="controls">
                <input ng-model="store.name" type="text" name="name" class="input-xlarge">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'行业类型'|translate}}:</label>
            <div class="controls">
                <industry-code ng-model="store.industry_code" dft="1"></industry-code>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'是否是主店'|translate}}:</label>
            <div class="controls">
                <is-main ng-model="store.is_main" dft="1"></is-main>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label v-top">{{'logo'|translate}}：</label>
            <div class="controls">
                <img ng-src="{{store.logo_img}}" class="item-image">
                <br>
                <attachment owner-id="store.store_id ?store.store_id:1" owner-type="store" dhf-ng-model="store.logo_img" xtype="url" mult="false" title="Upload" use-type="png,jpeg,gif,jpg"></attachment>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label v-top">{{'address'|translate}}:</label>
            <div class="controls">
                <map callback="addresCallback(data,store)" lat="store.latitude" lng="store.longitude"></map>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'address'|translate}}:</label>
            <div class="controls">
                <input ng-model="store.address" type="text" name="address" class="input-xlarge">
            </div>
        </div>
        <div class="control-group">
            <label class="control-label v-top">{{'mobile'|translate}}:</label>
            <div class="controls">
                <input ng-model="store.phone" type="text" name="phone" class="input-xlarge">
            </div>
        </div>
        <div style="border:#FF0000 1px solid;" ng-if="store.is_main == 1">
            <div style="background: #ff0000; color: #ffffff;padding: 5px;">
                子店参数配置： 设置前请仔细学习
                <a href="{{addSubStoreDoc}}" target="_blank" style="color:yellow">使用文档</a>
            </div>
            <div class="control-group">
                <label class="control-label v-top">{{'选择权限组' | translate}}:</label>
                <div class="controls">
                    <span ng-if="roleInfo.name" style="color:#FF0000">
                        已选择：{{roleInfo.name}}
                    </span>
                    <chose-role ng-model="store.config.store_apply.role_id" role-check="roledata(roleInfo)"></chose-role>

                    <div class="sui-msg msg-error msg-clear help-block">
                        <div class="msg-con">子店管理人员所属权限组</div>
                    </div>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label v-top">{{'设置小程序'|translate}}:</label>
                <div class="controls">
                    <wx-app-list ng-model="store.config.store_apply.app_id" ary="sary" callbacks="wxaacallback(app_id)"> </wx-app-list>

                    <div class="sui-msg msg-error msg-clear help-block">
                        <div class="msg-con">子店可以使用的小程序</div>
                    </div>
                </div>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <button ng-click="storeAdd()" class="sui-btn btn-primary" ng-disabled="!store.name || !store.address || !store.phone">
                    {{'save' | translate}}
                </button>
            </div>
        </div>
    </form>
</div>